/**
 * Created by Dalyn on 2017/3/16.
 */
import Relay from "react-relay";

export default class frontPageMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { frontPage }`;
    }

    getVariables() {
        return {
            argsInput: {
              enId: this.props.enId,
              permissions: this.props.permissionId
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on frontPagePayload {
            frontPage {
                errorCode
                value
                totalResult
                id
                trade{
                  sale
                  buyNotFinsihedTotal
                  buy
                  saleFinishedSum
                  saleNotFinishedTotal
                  buyFinsihedTotal
                  saleFinishedTotal
                  buyFinsihedSum
                  buyNotFinsihedSum
                  saleNotFinishedSum
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on frontPagePayload {
                    frontPage {
                        errorCode
                        value
                        totalResult
                        id
                        trade{
                          sale
                          buyNotFinsihedTotal
                          buy
                          saleFinishedSum
                          saleNotFinishedTotal
                          buyFinsihedTotal
                          saleFinishedTotal
                          buyFinsihedSum
                          buyNotFinsihedSum
                          saleNotFinishedSum
                        }
                    }
                }
            `]
        }];
    }

}
